package com.ruoyi.binance.service.impl;

import com.ruoyi.binance.domain.BinanceSimulateConf;
import com.ruoyi.binance.mapper.BinanceSimulateConfMapper;
import com.ruoyi.binance.service.IBinanceSimulateConfService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 模拟交易配置Service业务层处理
 *
 * @author zq
 * @date 2025-09-22
 */
@Service
public class BinanceSimulateConfServiceImpl implements IBinanceSimulateConfService {
    @Autowired
    private BinanceSimulateConfMapper binanceSimulateConfMapper;

    /**
     * 查询模拟交易配置
     *
     * @param id 模拟交易配置主键
     * @return 模拟交易配置
     */
    @Override
    public BinanceSimulateConf selectBinanceSimulateConfById(Long id) {
        return binanceSimulateConfMapper.selectBinanceSimulateConfById(id);
    }

    /**
     * 查询模拟交易配置列表
     *
     * @param binanceSimulateConf 模拟交易配置
     * @return 模拟交易配置
     */
    @Override
    public List<BinanceSimulateConf> selectBinanceSimulateConfList(BinanceSimulateConf binanceSimulateConf) {
        return binanceSimulateConfMapper.selectBinanceSimulateConfList(binanceSimulateConf);
    }

    /**
     * 新增模拟交易配置
     *
     * @param binanceSimulateConf 模拟交易配置
     * @return 结果
     */
    @Override
    public int insertBinanceSimulateConf(BinanceSimulateConf binanceSimulateConf) {
        binanceSimulateConf.setCreateTime(DateUtils.getNowDate());
        return binanceSimulateConfMapper.insertBinanceSimulateConf(binanceSimulateConf);
    }

    /**
     * 修改模拟交易配置
     *
     * @param binanceSimulateConf 模拟交易配置
     * @return 结果
     */
    @Override
    public int updateBinanceSimulateConf(BinanceSimulateConf binanceSimulateConf) {
        binanceSimulateConf.setUpdateTime(DateUtils.getNowDate());
        return binanceSimulateConfMapper.updateBinanceSimulateConf(binanceSimulateConf);
    }

    /**
     * 批量删除模拟交易配置
     *
     * @param ids 需要删除的模拟交易配置主键
     * @return 结果
     */
    @Override
    public int deleteBinanceSimulateConfByIds(Long[] ids) {
        return binanceSimulateConfMapper.deleteBinanceSimulateConfByIds(ids);
    }

    /**
     * 删除模拟交易配置信息
     *
     * @param id 模拟交易配置主键
     * @return 结果
     */
    @Override
    public int deleteBinanceSimulateConfById(Long id) {
        return binanceSimulateConfMapper.deleteBinanceSimulateConfById(id);
    }
}
